import configparser
import os

#找到配置文件config.ini路径
conf_path = os.path.split(os.path.realpath(__file__))[0]
config_path = os.path.join(conf_path,"config.ini")

#实例化configparser类，读出配置文件中的内容
conf = configparser.ConfigParser()
conf.read(config_path,encoding='utf-8')

class ReadConfig:
    #获取url地址
    def get_url(self,name):
        value = conf.get('URL',name)
        return value

    #获取账号信息
    def get_account(self,name):
        value = conf.get('ACCOUNT',name)
        return value
